home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Utilities Experience
/
The Utilities Experience - Volume 1.iso
/
software
/
misc
/
a-d
/
dopus511
/
dopus_pch.lha
/
ARexx.lha
/
Arexx
/
PlayMod_MP.dopus5
< prev
next >
Wrap
Text File
|
1995-05-13
|
5KB
|
130 lines
/* Mod-Player v1.00 [13-May-1995] for Directory Opus 5.
By Leo Davidson ("Nudel", P0T-NOoDLE/Gods'Gift Utilities)
This version is for use with MultiPlayer by Bryan Ford, but should be
easy to adapt to any other player with an ARexx port, such as
Eagle/DeliTracker, DMP, etc.
(In fact, a DeliTracker version should come with this script!).
If you include the path of a module on the command line, using {f}, only
this mod will be played. If you omit the {f}, the program will play each
selected file in the first SOURCE lister, giving you a requester to go to
the next file or stop playing.
If the player's ARexx port is not found, the program will be run for
you (you should edit the path below). This means the script may fail if
you disable the player's ARexx port, or give an incorrect command line
to it.
If the player's ARexx port takes over a minute to appear, an error
requester will appear on the DOpus screen and the script will quit.
REMEMBER to add the "RUN" command to the player command line if it does
not automatically detach from the shell (MultiPlayer does)!
If the player was running to start with, or the user selects
"Leave Playing", the module will continue playing when the script finishes.
Otherwise, the player will be quit.
Call as:
------------------------------------------------------------------------------
ARexx DOpus5:ARexx/PlayMod_MP.dopus5 {Qp} [{f}]
------------------------------------------------------------------------------
Turn off all switches.
*/
/*- Path to MultiPlayer command --------------------------------------------*/
MultiPlayer = "DH0:Tools/Music/MultiPlayer"
/*--------------------------------------------------------------------------*/
options results
options failat 99
signal on syntax;signal on ioerr /* Error trapping */
parse arg DOpusPort FilePath
DOpusPort = Strip(Strip(DOpusPort,"B"," "),"B",'"')
FilePath = Strip(Strip(FilePath,"B"," "),"B",'"')
If DOpusPort~="" THEN Address value DOpusPort
ELSE Do
Say "Not correctly called from Directory Opus 5!"
Say "Load this ARexx script into editor for more info."
EXIT
END
Quit_After = "NO"
If ~ShowList("P","RXTRACKER") Then Do
Address Command MultiPlayer
Quit_After = "YES"
TickTick = Time(M)
Do While ~ShowList("P","RXTRACKER")
IF Time(M) - TickTick > 0 Then Do
dopus request '"Error loading MultiPlayer!'||X2C(0A)||'Check its command-line in the ARexx script itself." OK'
EXIT
END
END
END
/* If file-path was specified on command line, just play that mod, else
go through all the selected ones. */
If FilePath = "" Then Do
lister query source /* Get lister and set busy */
IF RC ~= 0 Then Do
dopus request '"You must have a SOURCE lister!" OK'
Call END_PART
End
Lister_Handle = RESULT
lister set Lister_Handle busy 1
lister query Lister_Handle numselentries /* Get info about selected */
Lister_NumSelEnt = RESULT /* entries & path to them */
lister query Lister_Handle path
Lister_Path = Strip(RESULT,"B",'"')
Do i=1 to Lister_NumSelEnt
lister query Lister_Handle firstsel
Temp_Name = Strip(RESULT,"B",'"')
lister select Lister_Handle Temp_Name 0
Temp_Path = Lister_Path || Temp_Name
Address RXTRACKER Load Temp_Path;Address RXTRACKER Play
If Lister_NumSelEnt - i > 0 Then Do
If Quit_After = "YES" Then
dopus request '"Playing module ' i ' of ' Lister_NumSelEnt ':' X2C(0A) Temp_Name '" Next|Leave Playing|Stop'
Else
dopus request '"Playing module ' i ' of ' Lister_NumSelEnt ':' X2C(0A) Temp_Name '" Next|Leave Playing'
IF RC = "0" THEN BreakIt = "YES"
IF RC = "2" THEN Do
BreakIt = "YES"
Quit_After = "NO"
END
End
Else Do
If Quit_After = "YES" Then
dopus request '"Playing module ' i ' of ' Lister_NumSelEnt ':' X2C(0A) Temp_Name '" Leave Playing|Stop'
Else
dopus request '"Playing module ' i ' of ' Lister_NumSelEnt ':' X2C(0A) Temp_Name '" Leave Playing'
IF RC = "1" Then Quit_After = "NO"
End
IF BreakIt = "YES" THEN BREAK
END
End
ELSE Do
Address RXTRACKER Load FilePath;Address RXTRACKER Play
If Quit_After = "YES" Then
dopus request '"Playing module:' X2C(0A) FilePath'" Leave Playing|Stop'
Else
dopus request '"Playing module:' X2C(0A) FilePath'" Leave Playing'
IF RC ~= "0" THEN Quit_After = "NO"
End
/*-- Restore the Lister for normal use --------------------------------------*/
syntax:;ioerr: /* In case of error, jump here */
END_PART_2:
If FilePath = "" Then Do
lister refresh Lister_Handle
lister set Lister_Handle busy 0
END
END_PART:
If Quit_After = "YES" Then Address RXTRACKER QUIT
EXIT